<?php

/**
 * Report actions.
 *
 * @package    utility
 * @subpackage Report
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 12479 2008-10-31 10:54:40Z fabien $
 */
class ReportActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
    //$this->forward('default', 'module');
  }
  
   public function executeGetRor(sfWebRequest $request)
  { //just for getting the station and billing date for RoR
  }
   public function executeViewRor(sfWebRequest $request)
  {
		$this->setLayout(false);
		
		$billing_month = $request->getParameter('billing_month');
		$billing_year = $request->getParameter('billing_year');
		$station_id = $request->getParameter('station_id');
		$billing_date = $billing_year.'-'.$billing_month.'-'.'01';
			
		$d = new Criteria();
		$d->addAscendingOrderByColumn(BillingPeer::CONSUMER_NO);
		$d->add(BillingPeer::BILLING_DATE, $billing_date);
		$d->add(BillingPeer::STATION_ID, $station_id);
		$this->bills = BillingPeer::doSelect($d);
		
		$display = BillingPeer::doSelectOne($d);
		
		$this->flag = true;
		if($display)
		{
			$this->station = $display->getStation();
			$this->bde_name = $display->getStation()->getName();
			$this->bill_month = $display->getBillingDate('M-Y');
		}
	
  } // END - executeViewRor
  
}// END - ReportActions 
